<?php
include($folder.'/layouts/code-behind/backend.php');
function blc_adatlapok_select($from, $itemsPerPage, $sortColumn, $sortDirection)
{
	$orderBy = $sortColumn.'_'.$sortDirection;
	return query(
	'SELECT i.title,i.id 
	FROM information i
	ORDER BY 
		CASE WHEN :orderBy = \'title_asc\' THEN i.title END ASC,
		CASE WHEN :orderBy = \'title_desc\' THEN i.title  END DESC
	LIMIT :from,:itemsPerPage', array('orderBy'=>$orderBy,'from'=>$from,'itemsPerPage'=>$itemsPerPage));
}
function blc_adatlapok_select_count()
{
	return queryScalar('SELECT COUNT(1) FROM information', null);
}
?>